import Vue from 'vue';
import App from './App';
import store from './store';
import utils from './utils/utils';
import request from '@/utils/request';
import rules from '@/utils/rules';
import clApi from '@/api';
import busConst from '@/utils/busConst';
import auth from '@/utils/auth';
import config from '@/config';
// import auth from '@/utils/auth';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

dayjs.locale('zh-cn');

import uView from 'uview-ui';
Vue.use(uView);

// 过滤方法
import * as filters from '@/utils/filters.js';
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]); // 插入过滤器名和对应方法
});

// Vue.component('qrCode', qrCode);

Vue.config.productionTip = false;
Vue.prototype.$utils = utils;
Vue.prototype.$rules = rules;
Vue.prototype.$request = request;
Vue.prototype.$clApi = clApi;
Vue.prototype.$config = config;
// Vue.prototype.$auth = auth;
Vue.prototype.$getEnvConfig = config.getEnvConfig;
Vue.prototype.$dayjs = dayjs;
Vue.prototype.$bus = new Vue();
Vue.prototype.$busConst = busConst;
Vue.prototype.$auth = auth;

App.mpType = 'app';

const app = new Vue({
  ...App,
  store,
});
app.$mount();
